package com.hx.reflect;

/**
 * @author jxlgcmh
 * @create 2019-05-11 11:35
 */
public class Demo6 {
    public static void main(String[] args) throws Exception {
        Demo6 demo6 = new Demo6();
        Object instance = demo6.getInstance("com.hx.bean.Student");
        System.out.println(instance);
    }

    public Object getInstance(String classpath) throws Exception {
        Class<?> clazz = Class.forName(classpath);
        return clazz.newInstance();
    }
}
